<%@ page import="java.util.List" %>
<%@ page import="database.Course" %>
<%@ page import="database.CourseDb" %><%--
  Created by IntelliJ IDEA.
  User: jimmyhsu
  Date: 2016/12/12
  Time: 15:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>已存在课程</title>
    <link rel="stylesheet" href="../../static/style/weui.css"/>
    <link rel="stylesheet" href="../../static/example/example.css"/>
    <link rel="stylesheet" href="../../static/style/myStyle.css"/>
    <%
        List<Course> courses = CourseDb.selectAllCourses();
    %>
</head>
<body style="background-color: transparent">
<%@include file="Do/checkAdminLogin.jsp"%>
<br><br>&nbsp;&nbsp;
<img src="../../static/image/arrow1.png" style="-ms-transform:rotate(90deg); /* IE 9 */
    -moz-transform:rotate(90deg); /* Firefox */
    -webkit-transform:rotate(90deg); /* Safari and Chrome */
    -o-transform:rotate(90deg); /* Opera */" onclick="location.href='importCourse.jsp'">
<h1 class = "page_title">已存在的课程&nbsp;<i class="icon icon_actionSheet" onclick='onImport()'></i></h1>
<table class='zebra'>
    <tr>
        <th width="30%" style="color: #FFFFFF">上课时间</th>
        <th width="20%" style="color: #FFFFFF">上课地点</th>
        <th style="color: #FFFFFF">课程名</th>
    </tr>
    <%
    for (Course course : courses) {
            %>
    <tr>
        <td><%=course.getDatetime()%></td>
        <td><%=course.getLocation()%></td>
        <td><%=course.getName()%></td>
    </tr>
    <%
    }
    %>
</table>
</body>
<script>
    function onImport(){
        location.href='importCourse.jsp';
    }
</script>
</html>
